

<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<link type="text/css" rel="stylesheet" href="${createLinkTo(dir:'css/csslxh',file:'lxh.css')}">
	<script type="text/javascript" src="${createLinkTo(dir:'js',file:'lxh.js')}"></script>
	<title>Edit Customer</title>
</head>

<style>
	.tableGray td { height:26px } 
</style>

<body style="margin:0; overflow:auto">

<table width="100%" height="23px" border="0" cellpadding="0" cellspacing="0" background="${createLinkTo(dir:'imagesmain',file:'grayListBg.gif')}">
  <tr>       
	<td width="50%" style="padding-top:2px;padding-left:10px;">
		<img src="${createLinkTo(dir:'imageslxh',file:'post.gif')}">
		<g:message code="lxh.func.edit"/><g:message code="lxh.display.detailName"/>
	</td>
	<td>&nbsp;</td>		
  </tr>  
</table>

<g:if test="${flash.message}">
	<div class="message">${flash.message}</div>
</g:if>

<g:hasErrors bean="${customerInstance}">
	<div class="errors">
		<g:renderErrors bean="${customerInstance}" as="list" />
	</div>
</g:hasErrors>

<g:form name="aForm" action="update" method="post" style="display:inline" >
	<input type="hidden" name="id" value="${customerInstance?.id}" />
	<input type="hidden" name="version" value="${customerInstance?.version}" />
	
	<table align="center" class="tableGray" cellpadding="0" cellspacing="1" style="margin-top:5px;">
	
	    <tr>
	    	<td class="tableGrayLeftTd">
	        	<g:message code="Customer.custName"/>:&nbsp;
	        </td>
	        <td>
	        	<input type="text" id="custName" name="custName" value="${fieldValue(bean:customerInstance,field:'custName')}" class="textccc" maxlength="30" autoCheck="blank" autoWarn="<g:message code='Customer.custName'/><g:message code='warn.noblank'/>" />
	        </td>
	    </tr> 
	    	
	    <tr>
	    	<td class="tableGrayLeftTd">
	        	<g:message code="Customer.sex"/>:&nbsp;
	        </td>
	        <td>
	        	<g:select id="sex" name="sex" from="${customerInstance.constraints.sex.inList}" value="${customerInstance.sex}" ></g:select>
	        </td>
	    </tr> 
	    	
	    <tr>
	    	<td class="tableGrayLeftTd">
	        	<g:message code="Customer.birth"/>:&nbsp;
	        </td>
	        <td>
	        	<g:lxhDatePicker name="birth" value="${customerInstance?.birth}" ></g:lxhDatePicker>
	        </td>
	    </tr> 
	    	
	    <tr>
	    	<td class="tableGrayLeftTd">
	        	<g:message code="Customer.points"/>:&nbsp;
	        </td>
	        <td>
	        	<input type="text" id="points" name="points" value="${fieldValue(bean:customerInstance,field:'points')}" size="10" class="textccc" autoCheck="number" autoWarn="<g:message code='Customer.points'/><g:message code='warn.number'/>" /> <span class='fontRed'><g:message code='note.number'/></span>
	        </td>
	    </tr> 
	    	
	    <tr>
	    	<td class="tableGrayLeftTd">
	        	<g:message code="Customer.custLevel"/>:&nbsp;
	        </td>
	        <td>
	        	<g:select id="custLevel" name="custLevel" from="${customerInstance.constraints.custLevel.inList}" value="${customerInstance.custLevel}" ></g:select>
	        </td>
	    </tr> 
	    	
	    <tr>
	    	<td class="tableGrayLeftTd">
	        	<g:message code="Customer.memFee"/>:&nbsp;
	        </td>
	        <td>
	        	<input type="text" id="memFee" name="memFee" value="${fieldValue(bean:customerInstance,field:'memFee')}" size="10" class="textccc" autoCheck="decimal" autoWarn="<g:message code='Customer.memFee'/><g:message code='warn.decimal'/>" /> <span class='fontRed'><g:message code='note.decimal'/></span>
	        </td>
	    </tr> 
	    	
	    <tr>
	    	<td class="tableGrayLeftTd">
	        	<g:message code="Customer.memo"/>:&nbsp;
	        </td>
	        <td>
	        	<textarea rows="5" cols="40" name="memo">${fieldValue(bean:customerInstance, field:'memo')}</textarea>
	        </td>
	    </tr> 
	    	
	            

	    <tr>
	    	<td align="center"  colspan="2" style="height:30px">
	    		<input type="button" value="<g:message code='lxh.btn.update'/>" class="btnGray" onclick="checkAndSubmit()">&nbsp;
	    		<input type="button" value="<g:message code='lxh.btn.cancel'/>" class="btnGray" onclick="history.back()">
	    	</td>
	    </tr>
	    
	</table>
	
</g:form>

                  
</body>

<script type="text/javascript">

function checkAndSubmit()
{
	if( !checkForm(aForm) )
	{
		return false;
	}

	aForm.submit();
}

</script>

</html>
